"""

from selenium.webdriver.support.ui import Select
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

driver = webdriver.Chrome()
driver.maximize_window()
driver.get('https://www.baidu.com/')

# 点击设置按钮
driver.find_element(By.ID,"s-usersetting-top").click()
sleep(2)
# 点击高级搜索
driver.find_element(By.XPATH,'//span[text()="高级搜索"]').click()
sleep(2)
#点击时间不限的下拉框元素
driver.find_element(By.XPATH,'//span[text()="时间不限"]').click()
sleep(2)
driver.find_element(By.XPATH,'//p[text()="一周内"]').click()

sleep(3)

driver.quit()

"""


# 练习
from selenium import webdriver
from selenium.webdriver.common.by import By
import time

driver = webdriver.Chrome()
driver.get("https://www.baidu.com/")
driver.find_element(By.XPATH,"//span[@id='s-usersetting-top']").click()
driver.find_element(By.XPATH,"//span[text()='高级搜索']").click()
time.sleep(2)
driver.find_element(By.XPATH,"//span[text()='时间不限']").click()
time.sleep(2)
driver.find_element(By.XPATH,"//p[text()='一周内']").click()
time.sleep(2)

# 总结
# 下拉框 非select 注意是否需要切换页面，一般无跳转新页面链接的 则不需要切换页面操作。